import request from '@/utils/request.js'
export const addCart = (userId, productId, quantity) => {
  return request.post('/cart/addCart', {
    userId,
    productId,
    quantity
  })
}

export const getTotalCart = (userId) => {
  return request.get('/cart/getTotalCart', {
    params: {
      userId
    }
  })
}

export const getCartList = (userId) => {
  return request.get('/cart/getCartList', {
    params: {
      userId
    }
  })
}

export const updateCart = (quantity, id) => {
  return request.get('/cart/update', {
    params: {
      id,
      quantity
    }
  })
}

export const deleteCart = (ids) => {
  return request.post('/cart/delete',
    { ids }
  )
}
